<?php
    /*
     * This example demonstrates how to register an mixin for future use.
     
     * Mixins should first be registered, which can be accomplished using
     * the static method registerMixin(), and supplying an mixin key
     * and the corresponding class name.  
     *
     * @author Walter Badillo
     */
     
    require dirname(__FILE__) . DIRECTORY_SEPARATOR . '_include.php';
    
    try {
        
        echo "\n";
        
        // register an unknown mixin first, using the following method
        ClassStructure_Mixin::registerMixin('log', 'Mixin_Log');
        
        $obj = new ClassStructure_Mixin_Delegator();
        
        echo "Test: Add an mixin, which has previously been registered:" . "\n";
        echo '---------------------------------------------------------' . "\n\n";
        
        $obj->__addMixin('log');
        
        $obj->log__logEvent('log message');
        
        echo "\n\n";
        
        //----------------------------------------------------------------------
        // Expose structure
        
        echo ClassStructure_UtilityFunctions::getObjectSignature($obj);
        
    } catch (Exception $obj_exception) {
        print_r($obj_exception);
    }
